﻿@using  MockSchoolManagement.ViewModels.Teachers
@model TeacherCreateViewModel
@{ ViewBag.Title = "编辑教师信息"; }

<form asp-action="edit" method="post" class="mt-3">
    <div asp-validation-summary="All" class="text-danger"></div>
    <input type="hidden" asp-for="Id" />
    <div class="form-group row">
        <label asp-for="Name" class="col-sm-2 col-form-label"></label>
        <div class="col-sm-10">
            <input asp-for="Name" class="form-control" placeholder="请输入教师名称" />
            <span asp-validation-for="Name" class="text-danger"></span>
        </div>
    </div>

    <div class="form-group row">
        <label asp-for="HireDate" class="col-sm-2 col-form-label"></label>
        <div class="col-sm-10">
            <input asp-for="HireDate" type="date" class="form-control" placeholder="请输入聘用时间" />
            <span asp-validation-for="HireDate" class="text-danger"></span>
        </div>
    </div>

    <div class="form-group row">
        <label asp-for="OfficeLocation.Location" class="col-sm-2 col-form-label"></label>
        <div class="col-sm-10">
            <input asp-for="OfficeLocation.Location" class="form-control" placeholder="请输入办公室地址" />
            <span asp-validation-for="OfficeLocation.Location" class="text-danger"></span>
        </div>
    </div>
    <div class="form-group row">

        @for (int i = 0; i < Model.AssignedCourses.Count; i++)
        {

            <div class="form-check form-check-inline">
                <input type="hidden" asp-for="@Model.AssignedCourses[i].CourseID" />
                <input asp-for="@Model.AssignedCourses[i].IsSelected" class="form-check-input" />
                <label class="form-check-label" asp-for="@Model.AssignedCourses[i].IsSelected">
                    @Model.AssignedCourses[i].Title
                </label>
            </div>

        }
    </div>

    <div class="form-group row">
        <div class="col-sm-10">
            <button type="submit" class="btn btn-primary">更新</button>
            <a asp-action="index" class="btn btn-primary">取消</a>
        </div>
    </div>
</form>